home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / jcool01.zip / TEST_ASS.C < prev    next >
C/C++ Source or Header  |  1992-08-20  |  901b  |  45 lines

  1. #include <cool/List.h>
  2. #include <cool/Association.h>
  3. #include <test.h>
  4.  
  5. #include <cool/List.C>
  6. #include <cool/Pair.C>
  7. #include <cool/Vector.C>
  8. #include <cool/Association.C>
  9.  
  10. void test_int_list () {
  11.   CoolList<int> l1(1, 1);
  12.   CoolList<int> l2(2, 1, 2);
  13.   CoolList<int> l3(3, 1, 2 , 3);
  14.  
  15.   typedef CoolPair<int, CoolList<int> > Hack; //##
  16.   CoolAssociation<int,CoolList<int> > a;
  17.   cout << a << endl;
  18.   a.put(1, l1);
  19.   cout << a << endl;
  20.   a.put(2, l2);
  21.   cout << a << endl;
  22.   a.put(3, l3);
  23.   cout << a << endl;
  24.   a.put(4, l3);
  25.  
  26.   cout << a << endl;
  27.  
  28.   CoolList<int> l;
  29.   a.get(0, l);
  30.   l.describe(cout); cout << endl;
  31.   a.get(1, l);
  32.   l.describe(cout); cout << endl;
  33.   a.get(2, l);
  34.   l.describe(cout); cout << endl;
  35.   a.get(3, l);
  36.   l.describe(cout); cout << endl;
  37.   a.get(4, l);
  38.   l.describe(cout); cout << endl;
  39.   
  40. }
  41.  
  42. void main () {
  43.   test_int_list ();
  44. }
  45.